<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

<head>
	<base href="/">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    

    <title>后台 - 登录</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico"> <link href="static/templet/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="static/templet/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">

    <link href="static/templet/css/animate.min.css" rel="stylesheet">
    <link href="static/templet/css/style.min.css?v=4.0.0" rel="stylesheet"><base target="_blank">
    <!--[if lt IE 8]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
    <style type="text/css">
    .logo-name{color:#e6e6e6;font-size:160px;font-weight:800;letter-spacing:-10px;margin-bottom:0}
    </style>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <span class="logo-name">SEO</span>

            </div>
            <h3>欢迎使用 SEO</h3>

            <form class="m-t" role="form" action="index.html">
                <div class="form-group">
                    <input type="email" id="loginName" class="form-control" placeholder="用户名" required="">
                </div>
                <div class="form-group">
                    <input type="password" id="password" class="form-control" placeholder="密码" required="">
                </div>
                <div class="form-group">
								<div class="row">
									<div class="col-xs-6">
										<input type="text" class="form-control"
											id="code" placeholder="请输入验证码" />
									</div>
									<div class="col-xs-6 text-right">
										<img id="img_verify" style="max-width:100%;"
											src="code/captcha-image" />
									</div>
								</div>
				</div>
                <button type="button" id="loginBtn" class="btn btn-primary block full-width m-b">登 录</button>

            </form>
        </div>
    </div>
    </body>
    <script src="static/templet/js/jquery.min.js?v=2.1.4"></script>
    <script src="static/templet/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="static/templet/js/plugins/layer/layer.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
		$("#img_verify").on("click", function() {
			$(this).attr("src", "code/captcha-image?t=" + Math.random());
		});
		
		$("#loginBtn").on("click", function() {
			var loginName = $("#loginName").val();
			var password = $("#password").val();
			var code = $("#code").val();
			$.post('login/toLogin',{loginName:loginName,password:password,code:code}, function(data, status){
				if(status == 'success'){
					var result = data.result;
					var state = result.state;
					if(state == 1){
						layer.msg('登录成功', {icon: 1});
						location.href = 'main';
					}else{
						layer.msg(result.message, {icon: 1});
					}
				}
			})
		});
		
		$(document).keyup(function(event) {
			if (event.keyCode == 13) {
				$("#loginBtn").trigger("click");
			}
		});
    });
    </script>


</html>